UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ku2lVgEqZL2TSiuXDbUAbc7KU0UZiZk8iAaqhw7nqf4=' 
WHERE 
  key_id = '884a9e13e6ff4ca1454fd4dfa06fe2435a5eecec3fefad9312dbafc816b9de01' 
  AND (
    token = 'Ku2lVgEqZL2TSiuXDbUAbc7KU0UZiZk8iAaqhw7nqf4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047