UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fLZcKatGgGL8T+yJ2bagoPHU0z9m6cncbre3967sO00=' 
WHERE 
  key_id = '86ccc5665d64f36497e28c79b4f3b6d2ec326e9c3c85ef6cc4220db21429842b' 
  AND (
    token = 'fLZcKatGgGL8T+yJ2bagoPHU0z9m6cncbre3967sO00=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053