UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JSaOfu/vFzjOiMOAioBZf/4YmWQNuszD6IHoMYjxidg='
WHERE
key_id = '5a8a3f2d5281098662fc34f443693c7c55238d278a51fb8dbb5ce5e75dccf6a6'
AND (
token = 'JSaOfu/vFzjOiMOAioBZf/4YmWQNuszD6IHoMYjxidg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)