UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BdUim5rKs8ZmhXpTD9uaDu+EGAD8JkyXh6fuNmTjZaA=' 
WHERE 
  key_id = 'c7d7236f9bf7236329c4d0f6e92a45d16aab907fd8b7a2f1c4c238d6a76f086c' 
  AND (
    token = 'BdUim5rKs8ZmhXpTD9uaDu+EGAD8JkyXh6fuNmTjZaA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043