UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uEOUxFl5D6cMwCsGc8P29sQ3yBY9vj8ObKn8j/JGm7U=' 
WHERE 
  key_id = '18454805308d1d630cbe92fe4234045874044b43cdc6b52db43c14c65b58fdd7' 
  AND (
    token = 'uEOUxFl5D6cMwCsGc8P29sQ3yBY9vj8ObKn8j/JGm7U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00054