UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6TmkAioYkEDPbBe7YmYnKjWoivJ5h5nPadNUJDy2oE0=' 
WHERE 
  key_id = '7a47efd60c00923f004a6158c4b607ab10009dbff727ba2106911ba9ad073a68' 
  AND (
    token = '6TmkAioYkEDPbBe7YmYnKjWoivJ5h5nPadNUJDy2oE0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040