UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QSKTsSUllbIN/t1LUkKK4yhieaynFKAHV4s2rAFqYog='
WHERE
key_id = '321355eeab574942fc9120902396abf937e6d9d620cb4b4bb4207e9a4110c516'
AND (
token = 'QSKTsSUllbIN/t1LUkKK4yhieaynFKAHV4s2rAFqYog='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)