UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2kYOD+l5XplHl/L+sfN33mClpcedzylmdOLeqqs3644='
WHERE
key_id = 'e7d98974200bf55d7a82f711ad27dfe002c888a096b90a267904ed9cb92f9eba'
AND (
token = '2kYOD+l5XplHl/L+sfN33mClpcedzylmdOLeqqs3644='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)