UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uPRPo9cRT707B019unBvv3jB2oPE+WLBupctY+Y/8LY=' 
WHERE 
  key_id = '36ced280f1e53388ad4cf6c321a21ae3477de1fc1d813b03da218ea939ed73ea' 
  AND (
    token = 'uPRPo9cRT707B019unBvv3jB2oPE+WLBupctY+Y/8LY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034