UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'g4jyV/baOltblSFE/6Fa49aQyiPE0YG6lYt1oeQlNVI=' 
WHERE 
  key_id = '687e1b6e5a550c80f9980640133ef02aa35972e4b0ab58f8b0a8b66fc618be6c' 
  AND (
    token = 'g4jyV/baOltblSFE/6Fa49aQyiPE0YG6lYt1oeQlNVI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042