UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'U88dlKhVHbpuiYC7zt+pHBkKZ1L7BTvoi9FdRxbVWzI=' 
WHERE 
  key_id = '590009b5ac0437d01aa95d80f76ab78743d46319065bea3be3d6b0d7bb45c934' 
  AND (
    token = 'U88dlKhVHbpuiYC7zt+pHBkKZ1L7BTvoi9FdRxbVWzI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022