UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'k7+7utygZy46toH4CHR/U9zOKa9IbhJ02jI+Vm3W374='
WHERE
key_id = '7ca2a27b3aa7006afec6cc9fed37f70fa8f6bcc0c27cb725d0f1ebb6be9823a1'
AND (
token = 'k7+7utygZy46toH4CHR/U9zOKa9IbhJ02jI+Vm3W374='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)