UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sqdaqluGWCzUGs+hRQ46exJJF9OAZsactLTR6xH+k6E='
WHERE
key_id = 'f4e1179f20f5b7b4da1ad5a330a9f59e59fa1f1ad654c6c3771d682b139a40ec'
AND (
token = 'sqdaqluGWCzUGs+hRQ46exJJF9OAZsactLTR6xH+k6E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)