UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JmcOnSLyIwfIFEje8PDpp/XJbOB8BO/s9PaqpBA4ZAI='
WHERE
key_id = '7d96e865918273521f0e59e681a7a0befdbbe9deecbfc5524057000b870fd97c'
AND (
token = 'JmcOnSLyIwfIFEje8PDpp/XJbOB8BO/s9PaqpBA4ZAI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)