UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Yu3ccg5wDsspkoKcxa4VMz90g7nl3o1+Ksme13RbtY8='
WHERE
key_id = '5956f5019b98f45c54f9bb3b207e552dba9945a7aa51fb4a7fb615a7338468a6'
AND (
token = 'Yu3ccg5wDsspkoKcxa4VMz90g7nl3o1+Ksme13RbtY8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)