UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bXRgtoQa8SXU1ALtdAh9MbJHoZnBVmzLcroMOPBO7l8='
WHERE
key_id = '5c867c0ba7b36ecf1eddc5b4392b5b43e65c2dd21cbbe5c7173ab742b7c579b8'
AND (
token = 'bXRgtoQa8SXU1ALtdAh9MbJHoZnBVmzLcroMOPBO7l8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)