UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '73RGyBtW4+ZNoXRjGYxa3QaTmMxn7O+bBcA7zzQ2U2Y=' 
WHERE 
  key_id = '0a21375273f3dc4ea81b246e2ba28719e945bde8e681ae462747233d25f408e3' 
  AND (
    token = '73RGyBtW4+ZNoXRjGYxa3QaTmMxn7O+bBcA7zzQ2U2Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026