UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xjcMJA0tX1I6qr2vUdFDR2Lec971yykJIZbSH0JqbmY='
WHERE
key_id = '1260d3bd62f70c8500dc2a49b656732c2b936fb30f646fa0e58d3aa7b1153c0e'
AND (
token = 'xjcMJA0tX1I6qr2vUdFDR2Lec971yykJIZbSH0JqbmY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)