UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nFMeyCenw8FsFPO/0wYzsEMgN9EBV+U0+TlRp5DA/pE=' 
WHERE 
  key_id = '42b5aeba34cd1857407e462e60de40e609350bcf7bdcd9de306495b64bae7619' 
  AND (
    token = 'nFMeyCenw8FsFPO/0wYzsEMgN9EBV+U0+TlRp5DA/pE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035