UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EVPMJIevjvMc+Nmf+PZRJnd61LtiaiG6M2hKAUEgOdo='
WHERE
key_id = '3ab0a4b66f808dd5b5258818428ef3ee6c97403900731427fe6b7abbc8d7a6c3'
AND (
token = 'EVPMJIevjvMc+Nmf+PZRJnd61LtiaiG6M2hKAUEgOdo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)