UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DEZyUeXFZRdYRbKCSvSmnoEUJkUBo1JyNbhfmEPfN0s='
WHERE
key_id = '7c389e05db9bc7259e17853e421f4a5eae9c23d47f66880a786b607d1551e54c'
AND (
token = 'DEZyUeXFZRdYRbKCSvSmnoEUJkUBo1JyNbhfmEPfN0s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)