UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'utYxnysNN61HNr4RWYdVyNjJx/NhSlEQ0g1Niyk2tCM=' 
WHERE 
  key_id = 'c2710a0b33d36b24ee55707e7bffb0d5e91fa2e55a2f2152720f9ab61b4ab3f6' 
  AND (
    token = 'utYxnysNN61HNr4RWYdVyNjJx/NhSlEQ0g1Niyk2tCM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042