UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bLx4uRCoPUXEhMTtb8GE3zLN8jo+cbrNOgT2qEj15KY=' 
WHERE 
  key_id = '80edc7d2d243fe504c2144838da5ebb99ab99b295ad7f156776865298ce25fec' 
  AND (
    token = 'bLx4uRCoPUXEhMTtb8GE3zLN8jo+cbrNOgT2qEj15KY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022