UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gLtSnYQ4tcKzPq1dYIvlxFym213WW6s9EDZr3aNJTCQ='
WHERE
key_id = '6cba4b1dd3b99138ada2094bfe2b031d4046f5e5a262c9df3066ad34cdf9f204'
AND (
token = 'gLtSnYQ4tcKzPq1dYIvlxFym213WW6s9EDZr3aNJTCQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)