UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sRTXTRUGrQM3NmjidiLX17HzQY19lvtVfLH2y/DvYAI=' 
WHERE 
  key_id = 'b1e1ea692f63a2ec2524974370290d803743539f377b005b0b7194a750d10ade' 
  AND (
    token = 'sRTXTRUGrQM3NmjidiLX17HzQY19lvtVfLH2y/DvYAI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024