UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '75Vp3oCAbLD6GTl5Swa4hG4kwQfzp9aBdpIXBLat8P4='
WHERE
key_id = 'a59257bf055e31128116ed3f0ea60435237063a68ab86e07b50e57e1afe50bb0'
AND (
token = '75Vp3oCAbLD6GTl5Swa4hG4kwQfzp9aBdpIXBLat8P4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)