UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5VO2Ya8B0O4uvoJ8lT+WNBXGxbhej5xf3F45CUokd9A=' 
WHERE 
  key_id = '3d43f80c2ec7182ef007d78d8f21e351b9d624306570ba7d992bc3aabc997206' 
  AND (
    token = '5VO2Ya8B0O4uvoJ8lT+WNBXGxbhej5xf3F45CUokd9A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039