UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QFCALsITL5+bjbyIidV6GLwgzhhZkGburgyMbqGkSfA='
WHERE
key_id = 'a5d3def040bab4cb1b777fb1c0c0fa2c0115e1bb81f9052b31629e6ed981f3d0'
AND (
token = 'QFCALsITL5+bjbyIidV6GLwgzhhZkGburgyMbqGkSfA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)