UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Hg6rz9kvue7vV7CCOZ6MZ+xcKNKueu8gkaciUceCFho=' 
WHERE 
  key_id = '6aa5389fa49cb3ee2c1bb74c881fcde966b82da0d34d35443c551489fb0c3b3c' 
  AND (
    token = 'Hg6rz9kvue7vV7CCOZ6MZ+xcKNKueu8gkaciUceCFho=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00054