UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8cem11/IGS70Q7bMuprsWwsn55QcpsB69zaiElvB/wY='
WHERE
key_id = 'cea7b16daaf4fa81ce0a64854796a1a905935a0117b01c6fe41dc89fecc7b26f'
AND (
token = '8cem11/IGS70Q7bMuprsWwsn55QcpsB69zaiElvB/wY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)