UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HniCkNjkF3qlkYQaiyhI1XBAXMRyOEo1gps3lWeL1uE='
WHERE
key_id = 'ad0dfa4a82bc693c796c9fb8dca8ebd329913f0a2ca2e42d0b406553ccaab93c'
AND (
token = 'HniCkNjkF3qlkYQaiyhI1XBAXMRyOEo1gps3lWeL1uE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)