UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6BdKcdA0yHI92wJGY+LG+lgC9v6gTforxjO4ynkr1PE=' 
WHERE 
  key_id = '60c190933a38b277c542f02faf811e870ff160a0d12fe4cb97b205e35ce1a3c2' 
  AND (
    token = '6BdKcdA0yHI92wJGY+LG+lgC9v6gTforxjO4ynkr1PE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047